package com.lenovo.smarttraffic.zm_Set;


import android.os.Bundle;
import android.webkit.JavascriptInterface;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;

import com.lenovo.smarttraffic.R;
import com.lenovo.smarttraffic.ui.activity.BaseActivity;

public class EtcActivity extends BaseActivity {

    private ProgressBar etc_progress;
    private WebView webView_etc;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initToolBar(findViewById(R.id.toolbar), true, "ETC账户");
        initView();
        initWeb();
    }


    private void initWeb() {
        webView_etc.getSettings().setJavaScriptEnabled(true);
        webView_etc.setWebViewClient(new WebViewClient());
        webView_etc.setWebChromeClient(new WebChromeClient());
        webView_etc.addJavascriptInterface(new jstoAndroid_etc(), "java");
        webView_etc.loadUrl("file:///android_asset/etc.html");
    }

    @Override
    protected int getLayout() {
        return R.layout.activity_etc;
    }

    class jstoAndroid_etc extends Object {
        @JavascriptInterface()
        public void bin() {

        }
    }

    private void initView() {
        etc_progress = (ProgressBar) findViewById(R.id.etc_progress);
        webView_etc = (WebView) findViewById(R.id.webView_etc);
    }
}
